Ruby
epub, pdf | eng | | Author: Jay McGavren By the way, the code at right breaks a convention: for consistency, all of your type’s methods can take value receivers, or they can all take pointer receivers, but you ...
( Category: April 2,2020 )
epub, pdf | eng | 2008-03-19 | Author: Russ Olsen proxy = BankAccountProxy.new(account) proxy.deposit(50) proxy.withdraw(10) * * * There really is nothing very exciting going on in BankAccountProxy. The BankAccountProxy presents exactly the same interface as its subject, the BankAccount ...
( Category: March 20,2020 )
azw3, epub | eng | 2018-04-16 | Author: Stefan Wintermeyer <ul> <% product.errors.full_messages.each do |message| %> <li><%= message %></li> <% end %> </ul> </div> <% end %> <div class="field"> <%= f.label :name %> <%= f.text_field :name %> </div> <div class="field"> ...
( Category: February 29,2020 )
epub | eng | | Author: Arundel, John We've passed in an array of strings to the dotfile parameter of our ssh_user definition. Here's where that gets expanded into resource declarations: if $dotfile { $filepath = regsubst($dotfile,'^(.*)$',"/home/${name}/.\\0", 'G') ...
( Category: February 28,2020 )
epub, mobi, pdf | eng | | Author: Steve Pugh [Pugh, Steve] The Code unless ARGV[0] and File.exists?(ARGV[0]) puts "\n\nUsage is wordScramble.rb <word.file>\n\n" exit end tries = 10 words = File.readlines(ARGV[0]) mystery_word = words[rand(words.size)].chomp scramble_word = mystery_word.split(//).sort_by{rand}.join scramble_word.downcase! puts "\n\n\nThe scrambled word ...
( Category: February 10,2020 )
epub | eng | 2014-12-15 | Author: Jake Day Williams [Williams, Jake Day] puts :im_a_symbol.object_id puts :im_a_symbol.object_id Notice that both instances of the strings have different ID numbers, while the symbols have the same ID number. We will talk more about symbols soon. ...
( Category: December 17,2015 )
epub, mobi, pdf | eng | 2015-06-17 | Author: Larkin, Michael 3. Create the test in /spec/services/contest_results_spec.rb: describe ContestResults do context "initialize" do it "should raise exception if not an array" do expect {ContestResults.new([1])}.to_not raise_error expect {ContestResults.new([1,2,3,4])}.to_not raise_error expect {ContestResults.new(["a","b"])}.to_not raise_error ...
( Category: November 27,2015 )
epub | eng | | Author: Paolo Perrotta ​ ​def​ self.now; ​'Mon Apr 06 12:15:50'​; ​end​ ​ ​end​ ​ ​ require ​'test/unit'​ ​ ​ ​class​ TestLoan < Test::Unit::TestCase ​ ​def​ test_conversion_to_string ​ Loan.instance_eval { @time_class = FakeTime } ...
( Category: July 18,2015 )
epub | eng | 2009-02-08 | Author: Fitzgerald, Michael [Michael Fitzgerald] /pattern/options Pattern pattern in slashes, followed by optional options, one or more of: i = case-insensitive; o = substitute once; x = ignore whitespace, allow comments; m = match multiple ...
( Category: April 6,2014 )